package com.example.lottery.exception;

import com.example.lottery.enums.HttpCodeEnum;
import lombok.Data;

/**
 * 自定义异常
 * @author wenhao.wang
 */
@Data
public class BusinessException extends RuntimeException {

    //错误码
    private Integer code;

    public BusinessException(HttpCodeEnum httpCodeEnum) {
        super(httpCodeEnum.getName());
        this.code = httpCodeEnum.getIndex();
    }


    public BusinessException(Integer code,String message) {
        super(message);
        this.code = code;
    }

}
